//本地密码简单验证
/* eslint-disable no-unused-vars */
import ss from '/@/utils/sm4'

interface BaseType{
    invalid(userName: string, password: string): boolean
}

class Password implements BaseType{
    invalid(userName: string, password: string): boolean {
        switch(userName){
            case 'admin':
                //123456
                if(ss.encrypt(password) == 'UbpJaKeEJ9X15QK6S5vhgg=='){
                    return false
                } else {
                    return true
                }
            case 'neusoft':
                //Neusoft12#$
                if(ss.encrypt(password) == 'BWBUKvdL99lHoxir06phMQ=='){
                    return false
                } else {
                    return true
                }
            case 'lwr':
                //123456
                if(ss.encrypt(password) == 'UbpJaKeEJ9X15QK6S5vhgg=='){
                    return false
                } else {
                    return true
                }
            default:
                return false
        }
    }
}

const password = new Password()
export default password